#!/usr/bin/python
# -*- coding: utf-8 -*-

import h5py
import numpy as np
import time

labels = []
images = []

t1 = time.clock()

with h5py.File('number.h5', 'r') as f:
    a = f.keys()
    print(list(a))
    for key in a:
        count = len(f[key])

        indextmps = [int(key) for x in range(count)]
        labels.extend(indextmps)
        images.extend(f[key])


labels = np.array(labels)
images = np.array(images)


print(labels.shape)
print(images.shape)



t2 = time.clock()
print(t2-t1)